using System.Collections.Generic;

namespace tutFuelCellGame
{
    public class Levels
    {
        public int CurrentLevel { get; set; }
        public IList<LevelInformation> LevelInformation
        {
            get { return _list.AsReadOnly(); }
        }

        public Levels()
        {
            _list = new List<LevelInformation>
                        {
                            new LevelInformation {NumOfBarriers = 10, NumOfFuelCells = 8, RoundTimeInSeconds = 30},
                            new LevelInformation {NumOfBarriers = 15, NumOfFuelCells = 10, RoundTimeInSeconds = 35},
                            new LevelInformation {NumOfBarriers = 20, NumOfFuelCells = 12, RoundTimeInSeconds = 40},
                            new LevelInformation {NumOfBarriers = 20, NumOfFuelCells = 15, RoundTimeInSeconds = 40},
                            new LevelInformation {NumOfBarriers = 25, NumOfFuelCells = 15, RoundTimeInSeconds = 50},
                            new LevelInformation {NumOfBarriers = 30, NumOfFuelCells = 18, RoundTimeInSeconds = 60},
                        };

            CurrentLevel = 0;
        }

        public LevelInformation Current { get { return LevelInformation[CurrentLevel]; } }

        private readonly List<LevelInformation> _list;

        public void GoToNextLevel()
        {
            CurrentLevel = ++CurrentLevel % _list.Count;
        }
    }
}